function [entrant] = OPT_E(bParams,oParams,lambda_e,optimal_firm)
% Calculates the value that R&D adds for an entrants for a given level of lambda_e

% Variables:
% bParams,oParams	see readme
% lambda_e          innovation intensity
% optimal_firm      optimal firm value

% Set parameters
	r = oParams.r;
	pi = oParams.pi;
    product_distribution_entrants = oParams.product_distribution_entrants;

	gamma = bParams.gamma;
	beta = bParams.beta;

% Calculate entrant value
	entrant = (lambda_e*([0 product_distribution_entrants] * optimal_firm') - (1-pi)*q_E(lambda_e,gamma,beta))/(r+lambda_e);

end
